import tkinter as tk
from PIL import Image, ImageTk

root = tk.Tk()

# 设置条形框,插入图片
image = Image.open("robot.png")
photo = ImageTk.PhotoImage(image)
# self.creat_img(origin, 2, 2, img)
canvas = tk.Canvas(root, bg='white',
                   height=500,
                   width=300)
canvas.create_image(20, 20, image=photo)
canvas.pack()
root.mainloop()
